<!DOCTYPE html>
<html>
<head>
<?php
	$language = $this->language();
	$name = system_controller_front::getInstance()->getRequest()->getActionName();
	$root = preg_replace_callback('/^([a-zA-Z]{1})(.*)$/is', create_function('$match', 'return strtoupper($match[1]).$match[2];'), $name);
?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" >
<meta http-equiv="Content-Language" content="<?php echo str_replace('_', '-', $this->language());?>" >
<title><?php echo $language->load($root);?> - Control Panel</title>
<link href="<?php echo $this->baseUrl('/static/style/' . $language . '/panel.css');?>" media="screen, projection" rel="stylesheet" type="text/css" >
<script type="text/javascript" src="<?php echo $this->baseUrl('/static/jquery/jquery-1.7.min.js');?>"></script>
<script type="text/javascript" src="<?php echo $this->baseUrl('/static/js/index.js');?>"></script>
<script type="text/javascript">
$(document).ready(function() {
	$('#menu>ul>li>ul').find('li:has(ul:not(:empty))>a').append('<span class="arrow"></span>');
	$("#menu>ul>li").bind('mouseover', function(){
		$(this).children('ul').slideDown('fast');
	}).bind('mouseleave', function(){
		$(this).children('ul').slideUp('fast');
	});
	$('#menu>ul>li>ul li').bind('mouseover', function(){
		$(this).children('ul').slideDown('fast');
	}).bind('mouseleave', function() {
		$(this).children('ul').slideUp('fast');
	});
});
</script>
<base target="mainFrame" />
</head>

<body id="panel-<?php echo $root;?>">
<div id="menu">
	<ul>
		<li<?php if($name == 'index') {?> class="active"<?php } ?>><a href="<?php echo $this->url('index/index');?>" target="_self"><?php echo $language->load('Home');?></a></li>
		<li<?php if($name == 'sale') {?> class="active"<?php } ?>>
			<a href="<?php echo $this->url('index/sale');?>" target="_self"><?php echo $language->load('Sales');?></a>
			<ul>
				<li><a href=""><?php echo $language->load('Purchase Order');?></a></li>
				<li><a href=""><?php echo $language->load('Backorder');?></a></li>
				<li><a href=""><?php echo $language->load('RMA Order');?></a></li>
				<li>
					<a href=""><?php echo $language->load('Products');?></a>
					<ul>
						<li><a href=""><?php echo $language->load('Product Condition');?></a></li>
						<li><a href=""><?php echo $language->load('Product Attribute');?></a></li>
						<li><a href=""><?php echo $language->load('Product Keyword');?></a></li>
						<li><a href=""><?php echo $language->load('Product Image');?></a></li>
						<li><a href=""><?php echo $language->load('Product Comment');?></a></li>
					</ul>
				</li>
				<li><a href=""><?php echo $language->load('Customer');?></a></li>
				<li><a href=""><?php echo $language->load('Promotion');?></a></li>
				<li><a href=""><?php echo $language->load('Invoice');?></a></li>
			</ul>
		</li>
		<li<?php if($name == 'catalog') {?> class="active"<?php } ?>>
			<a href="<?php echo $this->url('index/catalog');?>" target="_self"><?php echo $language->load('Catalog');?></a>
			<ul>
				<li><a href=""><?php echo $language->load('Category');?></a></li>
				<li><a href=""><?php echo $language->load('Manufacturer');?></a></li>
				<li><a href=""><?php echo $language->load('Shipping');?></a></li>
				<li><a href=""><?php echo $language->load('Payment');?></a></li>
				<li><a href=""><?php echo $language->load('CMS');?></a></li>
				<li><a href=""><?php echo $language->load('Download');?></a></li>
			</ul>
		</li>
		<li<?php if($name == 'system') {?> class="active"<?php } ?>>
			<a href="<?php echo $this->url('index/system');?>" target="_self"><?php echo $language->load('System');?></a>
			<ul>
				<li><a href=""><?php echo $language->load('Setting');?></a></li>
				<li><a href=""><?php echo $language->load('User');?></a></li>
				<li><a href=""><?php echo $language->load('Currency');?></a></li>
				<li><a href=""><?php echo $language->load('Region');?></a></li>
				<li><a href=""><?php echo $language->load('Safeguard');?></a></li>
				<li><a href=""><?php echo $language->load('File System');?></a></li>
				<li><a href=""><?php echo $language->load('Logs');?></a></li>
			</ul>
		</li>
		<li<?php if($name == 'supplier') {?> class="active"<?php } ?>>
			<a href="<?php echo $this->url('index/supplier');?>" target="_self"><?php echo $language->load('Supplier');?></a>
			<ul>
				<li><a href=""><?php echo $language->load('Order');?></a></li>
				<li><a href=""><?php echo $language->load('Product');?></a></li>
				<li><a href=""><?php echo $language->load('Warehouse');?></a></li>
			</ul>
		</li>
		<li<?php if($name == 'report') {?> class="active"<?php } ?>>
			<a href="<?php echo $this->url('index/report');?>" target="_self"><?php echo $language->load('Reports');?></a>
			<ul>
				<li><a href=""><?php echo $language->load('Purchase Order Statistics');?></a></li>
				<li><a href=""><?php echo $language->load('RMA Order Statistics');?></a></li>
				<li><a href=""><?php echo $language->load('Freight Statistics');?></a></li>
				<li><a href=""><?php echo $language->load('Discount Statistics');?></a></li>
				<li><a href=""><?php echo $language->load('Customer Statistics');?></a></li>
			</ul>
		</li>
	</ul>
</div>
<form action="<?php echo $this->url('index/index');?>" method="post" target="_self">
<div id="header" class="header">
	<h1>HiHiCar<sup>.com ®</sup></h1>
	<div>
		<h3>Welcome to HiHiCar,Inc! <label><?php echo $this->form()->select('language', (string)$language, array('onchange'=>'this.form.submit()'), array('en_US'=>'English', 'zh_CN'=>'简体中文'));?></label></h3>
		<p>
			<?php echo $language->load('Hi');?>,<strong><?php echo system_passport::getInstance()->getStorage()->getIdentity();?></strong><?php
			if($this->user) {
				echo '(' . $this->user->getGroupName() . ')';
			} ?>! <a href="<?php echo $this->url('index/logout');?>" onclick="return confirm('<?php echo $language->load('Are you sure to logout system?');?>');" target="_self"><?php echo $language->load('Logout');?>!</a>
		</p>
	</div>
</div>
</form>
<div id="maskDiv"></div>
<div id="body">
<?php echo $this->content;?>
</div>
</body>
</html>